package com.andy.eqm.server.entity;

import com.andy.eqm.server.game.GameConf;
import com.andy.eqm.server.utils.ListTuple;

public class ConfItem extends BaseEntity{

	private static final long serialVersionUID = 1L;

	public ConfItem() {
	}
	
	public ConfItem(Long id) {
		super(id);
	}
	
	private int itemId; // 物品id
	private String name; // 物品名称
	private int type; // 物品类型
	
	private Integer multiple; // 掉落概率

	public static String table() {
		return "conf_item";
	}

	public Integer getMultiple() {
		return multiple;
	}

	public void setMultiple(Integer multiple) {
		this.multiple = multiple;
	}

	private ListTuple listTuple;
	public ListTuple listTuple(){
		if(listTuple == null){
			listTuple = new ListTuple(GameConf.getPropGroup(multiple));
		}
		return listTuple;
	}
	
	/**
	 * 随机物品id
	 * @return 物品id
	 */
	public ConfProbability tryRateItem(){
		return listTuple().selTuple().getFir();
	}

	public int getItemId() {
		return itemId;
	}

	public void setItemId(int itemId) {
		this.itemId = itemId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}


}
